<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dify - Offline</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            text-align: center;
            padding: 20px;
        }
        
        .container {
            max-width: 600px;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
        }
        
        .icon {
            width: 100px;
            height: 100px;
            margin: 0 auto 30px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
        }
        
        h1 {
            font-size: 32px;
            font-weight: 600;
            margin-bottom: 15px;
        }
        
        p {
            font-size: 18px;
            line-height: 1.6;
            opacity: 0.9;
            margin-bottom: 30px;
        }
        
        button {
            background: white;
            color: #764ba2;
            border: none;
            padding: 15px 30px;
            font-size: 16px;
            font-weight: 600;
            border-radius: 50px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        }
        
        button:active {
            transform: translateY(0);
        }
        
        @media (max-width: 640px) {
            .container {
                padding: 30px;
            }
            
            h1 {
                font-size: 24px;
            }
            
            p {
                font-size: 16px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="icon">
            ⚡
        </div>
        <h1>You're Offline</h1>
        <p>
            It looks like you've lost your internet connection. 
            Some features may not be available until you're back online.
        </p>
        <button onclick="window.location.reload()">
            Try Again
        </button>
    </div>
    
    <script>
        // Check for connection status changes
        window.addEventListener('online', function() {
            window.location.reload();
        });
        
        // Periodically check if online
        setInterval(function() {
            fetch(window.location.origin, { method: 'HEAD' })
                .then(function() {
                    window.location.reload();
                })
                .catch(function() {
                    // Still offline
                });
        }, 5000);
    </script>
</body>
</html>